<template>
  <div>
    <van-picker
      class="picker"
      title="性别"
      show-toolbar
      :columns="columns"
      @cancel="$emit('close')"
      @confirm="onConfirmPicker"
    />
    <!-- @change="onPickerChange" -->
    <!-- @confirm="onConfirm" -->
  </div>
</template>

<script>
export default {
  data () {
    return {
      columns: ['男', '女']
    }
  },
  created () {

  },
  mounted () {

  },
  methods: {
    onConfirmPicker (value, index) {
      // console.log(value, index) 男 0 女 1
      this.$emit('changeSex', value)
    }
    // onPickerChange (picker, value, index) {

    // }
  }
}
</script>

<style scoped lang="less">
/deep/.van-picker__confirm,
/deep/.van-picker__cancel {
  color: #3F51B5;
}
</style>
